package com.unittec.drainage.provider.utils;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;

/**
 * @author copysun 产生一个当前时间+随机4位数的编号
 */
public class RandomNum {

    public static String getRandomNum() {
        String time = DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss");
        String randomNum = "";
        for (int i = 0; i < 4; i++) {
            randomNum += RandomUtil.randomInt(0, 9);
        }
        return time + randomNum;
    }
}
